#! /bin/csh -f
# Test example 5
# Ton Rullmann and Jurgen Doreleijers 
#  - output filtering suggested by Kris Boulez

echo ""
echo "Test Example 6: assignchk script"
echo "---------------------------"
#echo "Aqua directory:" $aquaroot
echo ""

\cp $aquaroot/exmpls/Test_Big.pdb .
\cp $aquaroot/exmpls/Test_Big.noe .
\rm aqua.cmm >& /dev/null

$aquaroot/scripts/assignchk Test_Big.pdb > assignchk_std.log

echo "=================================================================="
echo "Differences for output on standard out:"
echo "=================================================================="

diff assignchk_std.log $aquaroot/exmpls | gawk '{ tus = $0; getline \
    if (($0 !~ /Aqua program directory:/) && ($2 !~ /^[0-9].[0-9]u$/)) \
    { print tus; print $0 } }' -
echo ""

echo "=================================================================="
echo "Differences for output file assignchk.log:"
echo "=================================================================="

diff assignchk.log $aquaroot/exmpls | gawk '{ tus = $0; getline \
    if (($0 !~ /Reading lower/ ) && ($0 !~ /^..Now opening/ ) &&\
        ($0 !~ /StereoLIB-aqua/ ) && ($0 !~ /PseudoLIB-aqua/ ) && \
        ($0 !~ /Aqua program directory:/) && ($2 !~ /^[0-9].[0-9]u$/)) \
    { print tus; print $0 } }' -
echo ""

echo "=================================================================="
echo "Differences for output file AssignDAT-new:"
echo "=================================================================="

diff AssignDAT-new $aquaroot/exmpls | gawk '{ tus = $0; getline \
    if (($0 !~ /CREATED/ ) && ($2 !~ /^[0-9].[0-9]u$/)) \
    { print tus; print $0 } }' -
echo ""

echo "=================================================================="
echo "Differences for output file assigned.noe:"
echo "=================================================================="

diff assigned.noe $aquaroot/exmpls | gawk '{ tus = $0; getline \
    if (($0 !~ /CREATED/ ) && ($2 !~ /^[0-9].[0-9]u$/)) \
    { print tus; print $0 } }' -


exit(0)
